/*! @amzn/apswebapstaglibrary - web-client-bundle - v25.804.2314 - 2025-08-04 23:14:56 */ !function(){"use strict";const t=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function e(t){const e=(new TextEncoder).encode(t);let n=2166136261;for(let t=0;t>>0}const n=(t,e=200)=>t.length<=e?t:`${t.substring(0,e)}...`;let o=!1;try{((t,e)=>{const o=new Set,s=[];try{const e=t.top?.location.hostname;e&&o.add(e)}catch(t){const e=t;s.push(n(e.message))}try{o.add(t.location.hostname)}catch(t){const e=t;s.push(n(e.message))}try{const e=t.location.href;o.add(new URL(e).hostname)}catch(t){const e=t;s.push(n(e.message))}try{const t=e.URL;o.add(new URL(t).hostname)}catch(t){const e=t;s.push(n(e.message))}if(0===o.size)throw new Error(`Unable to determine hostname: ${JSON.stringify(s)}`);return o})(window,document).forEach((n=>{o||(o=((t,n)=>{for(let o=0;o<5;o++){const s=e(t+o.toString())%8e3,r=s%8;if(!(n[Math.floor(s/8)]&1<0&&r[r.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var i,r,o=e.call(t),a=[];try{for(;(void 0===n||n-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(r)throw r.error}}return a}function s(t,n,e){if(e||2===arguments.length)for(var i,r=0,o=n.length;r=0&&t<=1?t:1};"number"==typeof(null==t?void 0:t.error)&&this.v.set("error",n(t.error)),"number"==typeof(null==t?void 0:t.feat)&&this.v.set("feat",n(t.feat))},t.prototype.clearAndUpdateEventProcessingInterval=function(t){var n=this;"number"!=typeof t||t<=0||t!==this.m&&(clearInterval(this._),this._=setInterval(function(){try{n.processEventRecords()}catch(t){}},t),this.m=t)},t.prototype.processEventRecords=function(){for(var t=[],n=Array.from(this.p.keys()),e=function(e){var r=n[e],o=i.p.get(r),a=i.v.get(r);if(void 0===o||o.length<=0)return"continue";if(void 0===a||0===a)return o.length>=i.l&&(o.length=0,i.logEvent({eventCategory:r,eventName:"queue limit reached"})),"continue";var c=o.filter(function(t){return void 0!==t&&a>=Math.random()});o.length=0,t.push.apply(t,s([],u(c),!1))},i=this,r=0;rthis.STACK_MAX_LENGTH){return t.stack.substring(0,this.STACK_MAX_LENGTH-5)+"[...]"}return t.stack}catch(t){return"NO STACK: ERROR ON RETRIEVAL"}},t.prototype.getErrorName=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.name&&(n=t.name)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorMessage=function(t){var n="unknown";try{"string"==typeof t?n=t:void 0!==t.message&&(n=t.message)}catch(t){try{n="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){n="Client Error: Unable to provide more information"}}return n},t.prototype.getErrorContext=function(t){var n,e="unknown";try{"string"!=typeof t&&"context"in t&&(e=null!==(n=t.context)&&void 0!==n?n:"")}catch(t){try{e="Client Error: ".concat(t.name.toString()," - ").concat(t.message)}catch(t){e="Client Error: Unable to provide more information"}}return e},t}(),y=new g;!function(t){t.postulate="postulate",t.genericError="error"}(h||(h={}));var b="25.804.2314";function _(t,n,i){var r=new URL("https://prod.tahoe-analytics.publishers.advertising.a2z.com/logevent/putRecord"),o=t;try{"web-client-scenarios.aps.amazon.dev"===(null==i?void 0:i.hostname)?o=t+"-debug-only":window.Cypress&&(o=t+"-integration-test")}catch(t){}var a=e(e({},i),{eventSource:"aps_web_client_library",eventCategory:o,eventName:n,libraryVersion:b});Object.entries(a).forEach(function(t){var n=u(t,2),e=n[0],i=n[1];r.searchParams.append(e,i)}),fetch(r.toString(),{method:"GET",keepalive:!0,headers:{"x-api-key":"79db72eb0b5c7255afa54a253df24fb4a5ac916bf40b51c730df8850aa5665ca"}}).catch(function(){})}var x,S,E,A,C={A:setInterval,C:function(){var t;return null===(t=window[k])||void 0===t?void 0:t[R]},R:function(t){var n;void 0===t&&(t=window);try{return(null===(n=t.top)||void 0===n?void 0:n.location)||{href:"unknown",hostname:"unknown"}}catch(t){return{href:"unknown",hostname:"unknown"}}},I:_,j:function(t,n){return{eventTime:I(function(){return"".concat(Date.now())}),accountID:I(function(){return null==t?void 0:t.accountID}),libraryVersion:b,url:I(function(){return n().href}),hostname:I(function(){return n().hostname}),message:I(function(){return null==t?void 0:t.message}),condition:I(function(){return null==t?void 0:t.condition})}},O:function(t,n){var e,i;try{(null!=n?n:_)(h.genericError,"telemetry_core_failure",{errorName:null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"unknown",errorMessage:null!==(i=null==t?void 0:t.message)&&void 0!==i?i:"unknown"})}catch(t){(null!=n?n:_)(h.genericError,"telemetry_core_failure")}}},k="_aps_telemetry",R="alarms";function I(t){var n;try{return null!==(n=t())&&void 0!==n?n:"undefined"}catch(t){return function(t){try{return t instanceof Error?"Access Error: ".concat(t.name," - ").concat(t.message):"Access Error: Unknown error type"}catch(t){return"Access Error: Unable to provide more information"}}(t)}}!function(t){t.push="push",t.listenerSuccess="listenerSuccess",t.direct="direct"}(x||(x={})),function(t){t.internal="internal",t.apstag="apstag",t.webpage="webpage",t.dtbm="dtbm"}(S||(S={})),function(t){t.completed="completed",t.waiting="waiting",t.cancelled="cancelled"}(E||(E={})),function(t){t.started="started",t.error="error",t.unknown="unknown",t.deactivated="deactivated",t.analytics="analytics"}(A||(A={}));var j=e(e({},E),A),O=new Map([["_config/config/didLoad",function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return n.write("config/loaded",!0),[2,E.completed]})})}],["_config/requestViewerCountry/define",function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.account,r=t.customEvent;return o(this,function(t){if(void 0===(null===(e=r.detail)||void 0===e?void 0:e.code))throw new Error("Missing country code");if("string"!=typeof(n=r.detail.code)||0===n.trim().length)throw new Error('Invalid country code: "'.concat(n,'"'));return i.update(w,function(){return n}),[2,E.completed]})})}]]),D="apstag/configuration/fetch",P=new Map([[D,function(t){return r(void 0,[t],void 0,function(t){var n,e=t.account;return t.customEvent,o(this,function(t){switch(t.label){case 0:return(n=e.globalContext.document.createElement("script")).setAttribute("src","".concat("https://config.aps.amazon-adsystem.com/configs/").concat(e.id)),n.setAttribute("type","text/javascript"),n.setAttribute("async","async"),e.globalContext.document.head.appendChild(n),[4,new Promise(function(t,e){n.addEventListener("load",function(){t()}),n.addEventListener("error",function(t){e(t)})})];case 1:return t.sent(),[2,E.completed]}})})}]]);var M=new WeakMap;function N(t,n,i,r){void 0===i&&(i="root"),void 0===r&&(r=".");var o={nonModifiable:{set:function(t,n){throw new Error('Cannot set property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},deleteProperty:function(t,n){throw new Error('Cannot delete property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},defineProperty:function(t,n){throw new Error('Cannot define property "'.concat(String(n),'": "').concat(i,'" is not marked as modifiable.'))},setPrototypeOf:function(t){throw new Error('Cannot set prototype: "'.concat(i,'" is not marked as modifiable.'))}},modifiable:{set:function(t,n,e,i){try{return Reflect.set(t,n,e,i)}catch(i){if("TypeError"===i.name)return t[n]=e,!0;throw i}}},validating:{get:function(t,e,o){if("__raw__"===e)return M.get(o)||t;if("symbol"==typeof e)return Reflect.get(t,e,o);if(function(t){if(["asymmetricMatch","nodeType"].includes(t))return!0}(e))return Reflect.get(t,e,o);var a;try{a=Reflect.get(t,e,o)}catch(n){if("TypeError"!==n.name)throw n;a=t[e]}return N(a,n,"".concat(i).concat(r).concat(String(e)))},ownKeys:function(t){return Reflect.ownKeys(t).filter(function(t){var e="".concat(i).concat(r).concat(String(t));return void 0!==n[e]})}},function:{apply:function(t,e,r){var o=M.has(e)?M.get(e):e;return N(t.apply(o,r),n,"".concat(i,"()"))},get:function(t,n,e){return"__raw__"===n?M.get(e)||t:Reflect.get(t,n,e)}}},a=function(r){if(!1===r.verifiable)return t;if(t instanceof Set)return t.forEach(function(t){N(t,n,"".concat(i,".value"))}),t;if(t instanceof Map)return t.forEach(function(t,e){N(e,n,"".concat(i,".key")),N(t,n,"".concat(i,".value"))}),t;if(Array.isArray(t))return t.map(function(t){return N(t,n,"".concat(i,"[]"))});if("function"==typeof t){var a=new Proxy(t,o.function);return M.set(a,t),a}var u=e(e({},o.validating),(null==r?void 0:r.modifiable)?o.modifiable:o.nonModifiable);try{var s=new Proxy(t,u);return M.set(s,t),s}catch(n){if("TypeError"===n.name)return t;throw n}}(function(){var r,o=n[i];if(void 0===o){var a=".constructor"===(null!=i?i:"").slice(-12);!function(t,n,i){var r,o=function(){return!1};i||function(t,n,i){var r=window;void 0===r[k]&&(r[k]={}),void 0===r[k][R]&&(r[k][R]=[]);var o=r[k][R],a=n.toString();o.push({hash:t,context:e(e({},i),{condition:a})})}(t,o,n);var a=null!==(r=null==n?void 0:n.message)&&void 0!==r?r:"Postulate violation: ".concat(t,", ").concat(o);throw new Error(a)}("ea3914",{message:'Unauthorized usage for "'.concat(i,'": No validator has been defined')},a)}if(null===o)return{verifiable:!1};try{r=o(t,i)}catch(n){var u="Error, could not convert to string";try{u="string"==typeof t?'"'+t+'"':null!=t&&"function"==typeof t.toString?t.toString():Object.prototype.toString.call(t)}catch(t){}throw new Error('Validation failed for "'.concat(i,'": ').concat(n.message," - Received: ").concat(u))}return null!=r?r:{}}());return a}var T=function(t){if("number"!=typeof t)throw new Error("must be a number")},L=function(t){if("string"!=typeof t)throw new Error("must be a string")},U=function(t){if("boolean"!=typeof t)throw new Error("must be a boolean")},q=function(t){if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("must be a standard object")},z=function(t){return function(n){var e,i,r=!1;try{for(var o=a(t),u=o.next();!u.done;u=o.next()){var s=u.value;try{s(n),r=!0}catch(t){}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}if(!r)throw new Error("None of the validators passed")}},F=function(t){if(!Array.isArray(t))throw new Error("must be an array")};function V(t){return function(n){if(!1===t.includes(n))throw new Error("must be one of the following values: ".concat(JSON.stringify(t)))}}function J(t){return function(n,i){var r=t(n,i);return e({modifiable:!0},r)}}function B(t){return function(n,e){if(t===G)throw new Error("isAny cannot be used within isOptional");if(null!=n)return t(n,e)}}var H=function(t){if("function"!=typeof t)throw new Error("must be a function")},G=function(){},W=function(){return{verifiable:!1}},K=function(t){if(void 0!==t)throw new Error("must be undefined")},$=function(){function t(t){var n=t.scope,e=t.object,i=t.action,r=t.validators,o=t.handler;this.throwIfInvalid(n,e,i),this.name="".concat(n,"/").concat(e,"/").concat(i),this.handler=this.wrapHandler(o,r)}return t.prototype.wrapHandler=function(t,n){var i=this;return function(a){return r(i,void 0,void 0,function(){var i,r,u;return o(this,function(o){switch(o.label){case 0:return i=e(e({},i=a),{detail:N(i.customEvent.detail,null!==(r=null==n?void 0:n.detail)&&void 0!==r?r:{detail:G},"detail"),context:N(i.account.globalContext,null!==(u=null==n?void 0:n.context)&&void 0!==u?u:{context:G},"context")}),[4,t(i)];case 1:return[2,o.sent()]}})})}},t.prototype.throwIfInvalid=function(t,n,e){var i="".concat(t,"/").concat(n,"/").concat(e);if(!["consent/gppapi/attemptSync","consent/gppapi/didChange","consent/gppapi/syncData","consent/tcfapi/attemptSync","consent/tcfapi/didChange","log/analytics/setInterval","analytics/sampling/set"].includes(i)){var r=/^[a-z0-9][a-zA-Z0-9]*$/;if(!r.test(t)||!r.test(n)||!r.test(e))throw new Error("scope, object, and action must be alphanumeric and start with a lowercase. Received: ".concat(t,", ").concat(n,", ").concat(e));if(/[A-Z]/.test(e)&&!/^(will|did)/i.test(e))throw new Error("action must be a single verb (or a single verb prefixed by 'will' or 'did'). Received: ".concat(e))}},t}();function Q(t){if(new Set(t.map(function(t){return t.name})).size!==t.length)throw new Error("Duplicates found");return new Map(t.map(function(t){return[t.name,t.handler]}))}var Z="consent/isGPPListenerRegistered",Y="debugSession/end",X="prepend/events",tt="populator/ran",nt={key:"consent/hasPurposeOneConsent",default:!1},et=function(){function t(t){var n=this;this.getItem=function(t){var e=n.globalContext.document.cookie.split("; ").reduce(function(n,e){var i=e.split("=");return i[0]===t?decodeURIComponent(i.slice(1).join("=")):n},"");return e.length>0?e:null},this.removeItem=function(t,e){void 0===e&&(e="/"),n.setItem(t,"",0,e)},this.setItem=function(t,e,i,r){void 0===r&&(r="/");var o=new Date(i);if(!n.isValidDate(o))throw new Error("Invalid expiration date");n.globalContext.document.cookie="".concat(t,"=").concat(e,"; expires=").concat(o.toUTCString(),"; path=").concat(r,";")},this.globalContext=t}return t.prototype.isValidDate=function(t){return t instanceof Date&&!isNaN(t)},t}(),it=["scope/objectName",Y,X];function rt(t){return null===t||"object"!=typeof t?t:t instanceof Date?new Date(t.getTime()):t instanceof Array?t.reduce(function(t,n){return t.push(rt(n)),t},[]):t instanceof Set?Array.from(t.values()).reduce(function(t,n){return t.add(rt(n)),t},new Set):t instanceof Map?Array.from(t.entries()).reduce(function(t,n){return t.set(n[0],rt(n[1])),t},new Map):t instanceof Object?Object.keys(t).reduce(function(n,e){return n[e]=rt(t[e]),n},{}):t}var ot,at=function(){function t(t,n){var e=n.rootName;this.globalContext=n.globalContext;var i=this.globalContext[e].get(t);if(null==i)throw new Error('Missing "'.concat(t,'" account in userspace object'));this.id=t,this.store=i.store,this.queue=i.queue,this.store.has("listeners")||this.store.set("listeners",new Map)}return t.prototype.record=function(t,n){return r(this,void 0,void 0,function(){var i=this;return o(this,function(r){switch(r.label){case 0:return[4,new Promise(function(r,o){i.queue.push(new CustomEvent(t,{detail:e({resolve:r,reject:o,source:S.internal},n)}))})];case 1:return[2,r.sent()]}})})},t.prototype.recordListener=function(t,n){return r(this,void 0,void 0,function(){var i=this;return o(this,function(r){switch(r.label){case 0:return[4,new Promise(function(r,o){i.queue.push(new CustomEvent(t.name,{detail:e({resolve:r,reject:o,source:S.internal},n)}))})];case 1:return[2,r.sent()]}})})},t.prototype.recordListenerNonBlocking=function(t,n){this.recordListener(t,n).catch(function(t){})},t.prototype.read=function(t,n){var e,i,r,o,a=this.store.get(t);if(void 0!==a)return a;if(void 0!==(null==n?void 0:n.persist)&&n.persist){var c=this.readLocalStorage(t,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed});if(void 0!==c)return c}var d=null===(i=null===(e=null==n?void 0:n.default)||void 0===e?void 0:e.generators)||void 0===i?void 0:i.get(t);return void 0!==d?d.apply(void 0,s([],u(null!==(o=null===(r=null==n?void 0:n.default)||void 0===r?void 0:r.args)&&void 0!==o?o:[]),!1)):void 0},t.prototype.write=function(t,n,e){this.store.set(t,n),void 0!==(null==e?void 0:e.persist)&&e.persist&&this.writeLocalStorage(t,n,{usePrefix:!0,throwOnDisallowed:e.throwOnDisallowed})},t.prototype.use=function(t,n){var e,i=this.store.get(t.key);if(void 0!==i)e=i;else if(void 0!==(null==n?void 0:n.persist)&&n.persist){var r=this.readLocalStorage(t.key,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed});null!=r&&(e=r)}var o=null!=e?e:t.default;if("function"==typeof o||!1===(null==n?void 0:n.structuredClone))return o;try{return structuredClone(o)}catch(t){try{return rt(o)}catch(t){return y.logCoreError({id:"Core.library.Account.use",account:null,error:t}),o}}},t.prototype.update=function(t,n,i){var r=n(this.use(t,e(e({},i),{throwOnDisallowed:null==i?void 0:i.throwOnDisallowed})));if(void 0!==t.postProcessor&&(r=t.postProcessor(r)),this.store.set(t.key,r),void 0!==(null==i?void 0:i.persist)&&i.persist){if("string"!=typeof r)throw new Error("".concat(JSON.stringify(r)," must be a string to be writtable to browser storage"));this.writeLocalStorage(t.key,r,{usePrefix:!0,throwOnDisallowed:i.throwOnDisallowed})}},t.prototype.delete=function(t,n){this.store.delete(t),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed})},t.prototype.remove=function(t,n){this.store.delete(t.key),void 0!==(null==n?void 0:n.persist)&&n.persist&&this.deleteLocalStorage(t.key,{usePrefix:!0,throwOnDisallowed:n.throwOnDisallowed})},t.prototype.executeFuncWithConsent=function(t,n){if(!this.isAllowedToAccessInfoOnDevice())throw new Error("Invalid consent. API requires consent before execution.");return n.apply(t)},t.prototype.recordErrorEvent=function(t){y.logError(e(e({},t),{account:this}))},t.prototype.recordStatusChangeEvent=function(t){y.logFeature({id:t.id,account:this,feature:t.status,props:e({},t.props)})},t.prototype.recordGenericEvent=function(t){y.logFeature({id:t.id,account:this,feature:t.id,props:e({},t.props)})},t.prototype.isAllowedToAccessInfoOnDevice=function(){return this.updateUserConsent(),this.use(nt)},t.prototype.isAPStagAllowedToAccessInfoOnDevice=function(){return!0===this.globalContext.apstag._atsaaiod()},t.prototype.updateUserConsent=function(){try{var t=this.isAPStagAllowedToAccessInfoOnDevice();this.update(nt,function(){return t})}catch(t){}},t.prototype.getPersistedItemName=function(t){return"".concat("aps").concat(":").concat(this.id).concat(":").concat(t)},t.prototype.isBrowserStorageAllowed=function(t){var n=!1;try{n=this.isAllowedToAccessInfoOnDevice()}catch(t){}return n||it.includes(t)},t.prototype.setCookieStorage=function(t,n,e,i){var r,o,a,u=null===(r=null==i?void 0:i.throwOnDisallowed)||void 0===r||r;if(this.isBrowserStorageAllowed(t)){var s=null!==(o=null==i?void 0:i.usePrefix)&&void 0!==o&&o?this.getPersistedItemName(t):t;return new et(this.globalContext).setItem(s,n,e,null!==(a=null==i?void 0:i.path)&&void 0!==a?a:"/")}if(u)throw new Error("".concat(t," is not allowed to be set on cookie storage"))},t.prototype.readCookieStorage=function(t,n){var e,i,r=null===(e=null==n?void 0:n.throwOnDisallowed)||void 0===e||e;if(this.isBrowserStorageAllowed(t)){var o=null!==(i=null==n?void 0:n.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;return new et(this.globalContext).getItem(o)}if(r)throw new Error("".concat(t," is not allowed to be read from cookie storage"))},t.prototype.readLocalStorage=function(t,n){var e,i,r,o=null===(e=null==n?void 0:n.throwOnDisallowed)||void 0===e||e;if(this.isBrowserStorageAllowed(t)){var a=null!==(i=null==n?void 0:n.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;return null!==(r=this.globalContext.localStorage.getItem(a))&&void 0!==r?r:void 0}if(o)throw new Error("".concat(t," is not allowed to be read from browser storage"))},t.prototype.writeLocalStorage=function(t,n,e){var i,r,o=null===(i=null==e?void 0:e.throwOnDisallowed)||void 0===i||i;if(this.isBrowserStorageAllowed(t)){if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writtable to browser storage"));var a=null!==(r=null==e?void 0:e.usePrefix)&&void 0!==r&&r?this.getPersistedItemName(t):t;this.globalContext.localStorage.setItem(a,n)}else if(o)throw new Error("".concat(t," is not allowed to be written to browser storage"))},t.prototype.deleteLocalStorage=function(t,n){var e,i,r=null===(e=null==n?void 0:n.throwOnDisallowed)||void 0===e||e;if(this.isBrowserStorageAllowed(t)){var o=null!==(i=null==n?void 0:n.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.localStorage.removeItem(o)}else if(r)throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"))},t.prototype.readSessionStorage=function(t,n){var e,i,r=null===(e=null==n?void 0:n.throwOnDisallowed)||void 0===e||e;if(this.isBrowserStorageAllowed(t)){var o=null!==(i=null==n?void 0:n.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;if(o in this.globalContext.sessionStorage)return this.globalContext.sessionStorage.getItem(o)}else if(r)throw new Error("".concat(t," is not allowed to be read from browser storage"))},t.prototype.writeSessionStorage=function(t,n,e){var i,r,o=null===(i=null==e?void 0:e.throwOnDisallowed)||void 0===i||i;if(this.isBrowserStorageAllowed(t)){if("string"!=typeof n)throw new Error("".concat(JSON.stringify(n)," must be a string to be writable to browser storage"));var a=null!==(r=null==e?void 0:e.usePrefix)&&void 0!==r&&r?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.setItem(a,n)}else if(o)throw new Error("".concat(t," is not allowed to be written to browser storage"))},t.prototype.deleteSessionStorage=function(t,n){var e,i,r=null===(e=null==n?void 0:n.throwOnDisallowed)||void 0===e||e;if(this.isBrowserStorageAllowed(t)){var o=null!==(i=null==n?void 0:n.usePrefix)&&void 0!==i&&i?this.getPersistedItemName(t):t;this.globalContext.sessionStorage.removeItem(o)}else if(r)throw new Error("".concat(t," is not allowed to be touched/deleted in browser storage"))},t}(),ut="_system",st=function(t){function e(n,e){return t.call(this,ut,{globalContext:n,rootName:e})||this}return n(e,t),e}(at),ct=function(){function t(t,n,e){this.globalContext=t,this.rootName=n,this.dispatcher=e}return t.prototype.getAccounts=function(){return this.globalContext[this.rootName]},t.prototype.createUserspaceRoot=function(){null==this.getAccounts()&&(this.globalContext[this.rootName]=new Map)},t.prototype.createSystemAccount=function(){!1===this.getAccounts().has(ut)&&(this.getAccounts().set(ut,{queue:[],store:new Map}),new st(this.globalContext,this.rootName).store.set(v,Math.random()))},t.prototype.observeRootSet=function(){var t=this;this.getAccounts().set=function(n,e){Map.prototype.set.apply(this,[n,e]),t.equip()}},t.prototype.observeAccountQueuesPush=function(){var t=this;this.getAccounts().forEach(function(n){n.queue.push=function(){for(var n=[],e=0;e=1||Number.isNaN(t))&&(t<=0||Math.random()>=t)}var pt={key:"_internal/eventSources",default:new Map},ht={key:"_internal/processedEventSources",default:new Set},mt=[j.completed,j.error,j.cancelled,j.analytics],wt=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.N=function(t){var n;return null!==(n=t.store.get("_config/events/deactivations"))&&void 0!==n?n:new Set},t.prototype.T=function(t,n){return!0===this.N(t).has(n.type)||function(t,n){var e,i,r,o,a,u;try{var s=null===(r=null===(i=null===(e=t.detail)||void 0===e?void 0:e.restrictions)||void 0===i?void 0:i.allow)||void 0===r?void 0:r.hostnames;if(void 0!==s&&!vt(s))return!0;var c=null===(u=null===(a=null===(o=t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.hostnames;if(void 0!==c&&vt(c))return!0}catch(t){return n.recordErrorEvent({id:"hostnames",error:new Error(t)}),!1}return!1}(n,t)||function(t){var n,e,i,r,o,a,u=null===(i=null===(e=null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e.allow)||void 0===i?void 0:i.libraryVersions,s=null===(a=null===(o=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.restrictions)||void 0===o?void 0:o.block)||void 0===a?void 0:a.libraryVersions;return!(!Array.isArray(s)||!s.includes(c))||!(!Array.isArray(u)||u.includes(c))}(n)||function(t,n){var e,i,r,o,a,u,s=null===(r=null===(i=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.restrictions)||void 0===i?void 0:i.allow)||void 0===r?void 0:r.accounts,c=null===(u=null===(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.accounts;return!(!Array.isArray(c)||!c.includes(n.id))||!(!Array.isArray(s)||s.includes(n.id))}(n,t)||function(t){var n,e,i,r,o,a,u,s,c=null!==(r=null===(i=null===(e=null===(n=null==t?void 0:t.detail)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e.allow)||void 0===i?void 0:i.rate)&&void 0!==r?r:1;return!(!ft(null!==(s=null===(u=null===(a=null===(o=null==t?void 0:t.detail)||void 0===o?void 0:o.restrictions)||void 0===a?void 0:a.block)||void 0===u?void 0:u.rate)&&void 0!==s?s:1)&&!ft(c))}(n)},t.prototype.L=function(){var t;return null!==(t=new st(this.globalContext,this.rootName).store.get(d))&&void 0!==t?t:new Map},t.prototype.U=function(t){var n;return null!==(n=t.store.get("listeners"))&&void 0!==n?n:new Map},t.prototype.q=function(t,n){return this.L().get(n.type)||this.U(t).get(n.type)},t.prototype.F=function(t){var n=this.V(f);return(void 0===t.externalEventCount||t.externalEventCount150){var i=e.slice(-100);t.store.set(l,i)}}},t.prototype.gt=function(t){var n,e=null!==(n=t.store.get(l))&&void 0!==n?n:[];e.push.apply(e,s([],u(t.queue.filter(function(t){return void 0!==t.status&&mt.includes(t.status)})),!1)),t.store.set(l,e)},t.prototype.yt=function(t){var n;(n=t.queue).splice.apply(n,s([0,t.queue.length],u(t.queue.filter(function(t){return void 0===t.status||!mt.includes(t.status)})),!1))},t.prototype.bt=function(){var t=this;this.ht().forEach(function(n){t.gt(n),t.wt(n),t.yt(n)})},t.prototype._t=function(t){return null==t?void 0:t.filter(function(t){var n,e;return(null===(n=t.detail)||void 0===n?void 0:n.source)!==S.internal&&(null===(e=t.detail)||void 0===e?void 0:e.source)!==S.apstag&&t.status!==j.waiting})},t.prototype.xt=function(t){var n,e=this._t(t);return null!==(n=null==e?void 0:e.length)&&void 0!==n?n:0},t.prototype.St=function(t){var n=this.xt(t);this.H(f,n)},t.prototype.Et=function(){var t=this,n="_internal/recentDispatches";this.H(n,1);var e=this.V(n);if(e>1e4)throw new Error("Too many dispatches. Aborting");e%100==0&&new st(this.globalContext,this.rootName).recordGenericEvent({id:"C.l.D.thr",props:{recentDispatchesCount:e}}),setTimeout(function(){t.G(n)},100)},t.prototype.D=function(t){var n,e,i,r,o,a=this,u=t.reason;try{this.Et(),p()&<.info('# Dispatch from method "'.concat(u.method,'" on event "').concat(null!==(e=null===(n=u.events)||void 0===n?void 0:n[0].type)&&void 0!==e?e:"undefined",'" with source "').concat(null!==(o=null===(r=null===(i=u.events)||void 0===i?void 0:i[0].detail)||void 0===r?void 0:r.source)&&void 0!==o?o:"undefined",'"\n_________________________________________')),this.St(u.events);var s=new st(this.globalContext,this.rootName);this.ht().forEach(function(t){return a.lt(t,s,u)}),this.bt()}catch(t){throw new st(this.globalContext,this.rootName).recordErrorEvent({id:"C.l.D.dis",error:t}),t}},t}(),gt=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.subscribe=function(t){try{var n=new st(this.globalContext,this.rootName),e=null!=n.store.get(d)?n.store.get(d):new Map;n.store.set(d,new Map(s(s([],u(e),!1),u(t),!1)))}catch(t){throw new st(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Subscriber.subscribe",error:t}),t}},t}(),yt=function(){function t(t,n){this.globalContext=t,this.rootName=n}return t.prototype.populate=function(){try{var t=new st(this.globalContext,this.rootName),n=!1;try{n=JSON.parse(t.read(tt))}catch(t){}if(n)return;t.write(tt,JSON.stringify(!0)),this.populateFromPrependStore(),this.populateFromQueryParams()}catch(t){new st(this.globalContext,this.rootName).recordErrorEvent({id:"Core.library.Populator.populate",error:t})}},t.prototype.populateFromPrependStore=function(){var t=this;this.globalContext[this.rootName].forEach(function(n,e){var i,r,o=new at(e,{globalContext:t.globalContext,rootName:t.rootName}),a=null!==(r=o.read(X,{persist:!0}))&&void 0!==r?r:"[]";o.write(X,JSON.stringify([]));try{var c=JSON.parse(a);if(0===c.length)return;(i=o.queue).push.apply(i,s([],u(c.map(_t)),!1))}catch(t){console.error("Error processing prepended events",t)}})},t.prototype.populateFromQueryParams=function(){var t,n,e=null===(n=null===(t=this.globalContext)||void 0===t?void 0:t.location)||void 0===n?void 0:n.search,i=new URLSearchParams(e),r=this.globalContext[this.rootName],o=r.get(ut);bt(i,"aps.trigger").forEach(function(t){o.queue.push(_t(t))}),bt(i,"aps.triggerFor",!0).forEach(function(t){void 0!==t.accountId&&r.has(t.accountId)&&r.get(t.accountId).queue.push(_t(t))});var a=bt(i,"aps_event");r.forEach(function(t){a.forEach(function(n){t.queue.push(_t(n))})})},t}(),bt=function(t,n,e){void 0===e&&(e=!1);var i=t.getAll(n),r=[];return i.forEach(function(t){var n,i=t.split(",");e&&(n=i.shift());var o=i.shift();if(void 0!==o&&o.length>0){var a=decodeURIComponent(i.join(",")),u=void 0;if(a.length>0)try{u=JSON.parse(a)}catch(t){console.error("Error processing query param event",o,u)}r.push({eventName:o.replace(/_/g,"/"),eventDetail:u,accountId:n})}}),r},_t=function(t){var n;return new CustomEvent(t.eventName,{detail:e({},null!==(n=t.eventDetail)&&void 0!==n?n:{})})},xt={globalContext:window,rootName:"_aps"},St=function(){function t(t,n,e){this.ID=t,this.rootName=e,this.globalContext=n,this.clear()}return t.prototype.clear=function(){var t=this;new st(this.globalContext,this.rootName).update(pt,function(n){return n.delete(t.ID),n})},t.prototype.recordListener=function(t,n){var e=this;new st(this.globalContext,this.rootName).update(pt,function(i){var r=i.get(e.ID);return void 0!==r?r.push([t.name,n]):i.set(e.ID,[[t.name,n]]),i})},t}(),Et=function(){function t(t,n){void 0===t&&(t=xt.globalContext),void 0===n&&(n=xt.rootName),this.dispatcher=new wt(t,n),this.equiper=new ct(t,n,this.dispatcher),this.subscriber=new gt(t,n),this.populator=new yt(t,n),this.globalContext=t,this.rootName=n}return t.prototype.createAccount=function(t){var n;if(void 0===t)throw new Error("accountID must be provided");this.globalContext[this.rootName]=null!==(n=this.globalContext[this.rootName])&&void 0!==n?n:new Map;var e=this.globalContext[this.rootName],i={store:new Map,queue:[]};return!1===e.has(t)&&e.set(t,i),new at(t,{globalContext:this.globalContext,rootName:this.rootName})},t.prototype.subscribe=function(t){this.subscriber.subscribe(t)},t.prototype.equip=function(){this.equiper.equip()},t.prototype.dispatch=function(t){var n=t.reason;this.dispatcher.D({reason:n})},t.prototype.populate=function(){this.populator.populate()},t.prototype.load=function(t){var n=t.listeners;this.equip(),this.subscribe(n),this.dispatch({reason:{method:x.direct}}),this.populate()},t.prototype.registerEventSource=function(t){return this.equip(),new St(t,this.globalContext,this.rootName)},t}(),At=new $({scope:"consent",object:"gppapi",action:"syncData",validators:{detail:{detail:q,"detail.fromAddEvent":B(U),"detail.eventListener":B(q),"detail.eventListener.pingData":B(q),"detail.eventListener.pingData.gppString":B(L),"detail.eventListener.pingData.gppVersion":B(z([L,T])),"detail.eventListener.pingData.cmpId":B(z([L,T])),"detail.eventListener.pingData.applicableSections":F,"detail.eventListener.pingData.applicableSections[]":z([L,T])}},handler:function(t){return r(void 0,[t],void 0,function(t){var n,i,r,a,s,c,d,l,v,f,p,h,m=t.account,w=t.detail;return o(this,function(t){return(null!==(f=null===(v=null===(l=null==w?void 0:w.eventListener)||void 0===l?void 0:l.pingData)||void 0===v?void 0:v.gppString)&&void 0!==f?f:"").length>0?(n=null===(p=null==w?void 0:w.eventListener)||void 0===p?void 0:p.pingData,a="addEventListener"):(c=u(function(t){var n,e,i;try{var r=t.globalContext.__gpp("ping",function(t,n){n&&"object"==typeof t&&(e=t)});void 0===e&&(null!==(n=null==r?void 0:r.gppString)&&void 0!==n?n:"").length>0&&(e=r)}catch(t){i="E:ping: ".concat(t)}return[e,i]}(m),2),n=c[0],r=c[1],a="ping","object"!=typeof n&&(d=u(function(t){var n,i;try{var r=t.globalContext.__gpp("getGPPData");n=e(e({},r),r.pingData)}catch(t){i="E:getGPPData: ".concat(t)}return[n,i]}(m),2),n=d[0],i=d[1],a="getGPPData")),s={gpp:{gppLength:"string"==typeof(null==n?void 0:n.gppString)?n.gppString.length:void 0,isGPPTilde:(null!==(h=null==n?void 0:n.gppString)&&void 0!==h?h:"").includes("~"),error10:i,error:r,gppVersion:null==n?void 0:n.gppVersion,cmpId:null==n?void 0:n.cmpId,method:a,fromAddEvent:null==w?void 0:w.fromAddEvent}},m.write("consent/GPPData",n),[2,{status:E.completed,analytics:s}]})})}}),Ct=new $({scope:"consent",object:"gppapi",action:"didChange",validators:{detail:{detail:q,"detail.fromAddEvent":B(U),"detail.eventListener":B(q),"detail.eventListener.pingData":B(q),"detail.eventListener.pingData.gppString":B(L),"detail.eventListener.pingData.gppVersion":B(z([L,T])),"detail.eventListener.pingData.cmpId":B(z([L,T])),"detail.eventListener.pingData.applicableSections":F,"detail.eventListener.pingData.applicableSections[]":z([L,T])}},handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account,e=t.detail,i=e.eventListener,r=e.fromAddEvent;return o(this,function(t){switch(t.label){case 0:return[4,n.recordListener(At,{eventListener:i,fromAddEvent:r})];case 1:return t.sent(),[2,{status:E.completed}]}})})}}),kt=new $({scope:"consent",object:"gppapi",action:"attemptSync",handler:function(t){return r(void 0,[t],void 0,function(t){var n,e=t.account;return o(this,function(t){switch(t.label){case 0:return void 0===e.globalContext.__gpp||!0===e.read(Z)?[2,{status:E.cancelled}]:[4,e.recordListener(At)];case 1:return t.sent(),n=e.globalContext.__gpp("addEventListener",function(t){"error"!==(null==t?void 0:t.eventName)&&e.recordListenerNonBlocking(Ct,{eventListener:t,fromAddEvent:!0})}),e.write(Z,"listenerRegistered"===(null==n?void 0:n.eventName)&&!0===(null==n?void 0:n.data)),[2,{status:E.completed}]}})})}}),Rt={key:"consent/isTCFAPIListenerRegistered",default:!1},It={key:"consent/TCData",default:void 0};function jt(t,n){var e,i;return"string"==typeof(null==n?void 0:n.tcString)&&(null==n?void 0:n.tcString.length)>0||!0===(null===(i=null===(e=null==t?void 0:t.globalContext)||void 0===e?void 0:e.apstag)||void 0===i?void 0:i.isGDPRRegion)||!0===(null==n?void 0:n.gdprApplies)}function Ot(t,n){var e,i,r,o,a;return!0===(null===(i=null===(e=t.vendor)||void 0===e?void 0:e.consents)||void 0===i?void 0:i[793])&&(o=n,a=null===(r=t.purpose)||void 0===r?void 0:r.consents,(null!=o?o:[]).reduce(function(t,n){return t&&!0===(null==a?void 0:a[n])},!0))}var Dt=new $({scope:"consent",object:"tcfapi",action:"didChange",validators:{detail:{detail:q,"detail.success":B(U),"detail.tcData":B(z([L,q])),"detail.tcData.tcString":B(L),"detail.tcData.tcfPolicyVersion":B(T),"detail.tcData.cmpId":B(T),"detail.tcData.cmpVersion":B(T),"detail.tcData.useNonStandardStacks":B(U),"detail.tcData.gdprApplies":B(U),"detail.tcData.eventStatus":B(L),"detail.tcData.cmpStatus":B(L),"detail.tcData.listenerId":B(T),"detail.tcData.isServiceSpecific":B(U),"detail.tcData.useNonStandardTexts":B(U),"detail.tcData.publisherCC":B(L),"detail.tcData.purposeOneTreatment":B(U),"detail.tcData.purpose":B(q),"detail.tcData.purpose.consents":B(W),"detail.tcData.purpose.legitimateInterests":B(W),"detail.tcData.vendor":B(q),"detail.tcData.vendor.consents":B(W),"detail.tcData.vendor.legitimateInterests":B(W),"detail.tcData.specialFeatureOptins":B(W),"detail.tcData.publisher":B(q),"detail.tcData.publisher.consents":B(W),"detail.tcData.publisher.legitimateInterests":B(W),"detail.tcData.publisher.customPurpose":B(q),"detail.tcData.publisher.customPurpose.consents":B(W),"detail.tcData.publisher.customPurpose.legitimateInterests":B(W),"detail.tcData.publisher.restrictions":B(W)}},handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account,e=t.detail,i=e.success,r=e.tcData;return o(this,function(t){return n.update(Rt,function(t){return t||!0===i}),n.update(It,function(t){return void 0!==r||!0===i?r:t}),"object"!=typeof r?[2,{status:E.completed}]:[2,{status:E.completed,analytics:Pt(n,r)}]})})}}),Pt=function(t,n){var i={tcData:n,consents:[1]},r=function(t){try{return t()}catch(t){return"error"}};return{tcT:r(function(){return t.isAPStagAllowedToAccessInfoOnDevice()}),tcCC:r(function(){return function(t){var n,e=t.account,i=t.tcData,r=t.consents;if(!jt(e,i))return!0;if("object"!=typeof i)return!1;if((null!==(n=i.tcfPolicyVersion)&&void 0!==n?n:0)<2)return!1;if(i.useNonStandardStacks)return!1;if(!i.isServiceSpecific)return!1;var o=!1;return r.forEach(function(t){var n,e,a;switch(null===(a=null===(e=null===(n=i.publisher)||void 0===n?void 0:n.restrictions)||void 0===e?void 0:e[t])||void 0===a?void 0:a[793]){case 0:case 2:o=!0;break;default:Ot(i,r)||(o=!0)}}),!o}(e(e({},i),{account:t}))}),tcCF:r(function(){return 0===function(t){var n,e=t.tcData,i=t.consents;if(0===(null!=i?i:[]).length)return["No consents param passed"];var r=[];try{if("object"!=typeof e){var o="";try{o=JSON.stringify(e)}catch(t){}r.push("Invalid tcData: ".concat(o))}return!1===e.gdprApplies?[]:((null!==(n=e.tcfPolicyVersion)&&void 0!==n?n:0)<2&&r.push("tcData version not supported: ".concat(e.tcfPolicyVersion)),e.useNonStandardStacks&&r.push("tcData's useNonStandardStacks should not be true"),e.isServiceSpecific||r.push("tcData needs to be service specific"),i.forEach(function(t){var n,o,a;switch(null===(a=null===(o=null===(n=e.publisher)||void 0===n?void 0:n.restrictions)||void 0===o?void 0:o[t])||void 0===a?void 0:a[793]){case 0:r.push("Invalid publisher restrictions 0, consent ".concat(t));break;case 2:r.push("Invalid publisher restrictions 2, consent ".concat(t));break;default:Ot(e,i)||r.push("Invalid publisher restrictions default, consent ".concat(t))}}),r)}catch(t){if(r.length>0)return r;throw t}}(i).length}),PRA:r(function(){return jt(t,n)})}},Mt=new $({scope:"consent",object:"tcfapi",action:"attemptSync",handler:function(t){return r(void 0,[t],void 0,function(t){var n,e=t.account;return o(this,function(t){return n=e.use(Rt),void 0===e.globalContext.__tcfapi||n?[2,{status:E.cancelled}]:(e.globalContext.__tcfapi("addEventListener",2,function(t,n){e.recordListenerNonBlocking(Dt,{tcData:t,success:n})}),[2,{status:E.completed}])})})}}),Nt=Q([kt,Ct,At,Mt,Dt]),Tt="vnd_prx_segments",Lt="aps_targeting_comscore",Ut=new $({scope:"cxm",object:"comscore",action:"set",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,{status:qt(n)}]})})}}),qt=function(t){var n=t.readSessionStorage(Lt);if(t.deleteSessionStorage(Lt),null==n)return E.cancelled;try{var e=JSON.parse(n)[Tt];if(null==e)throw new Error;return t.globalContext.googletag.pubads().getSlots().forEach(function(t){t.setTargeting(Tt,e)}),E.completed}catch(t){throw new Error("Malformed targeting object at ".concat(Lt))}},zt="aps_targeting_ias",Ft=new $({scope:"cxm",object:"ias",action:"set",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,{status:Vt(n)}]})})}}),Vt=function(t){var n=t.readSessionStorage(zt);if(t.deleteSessionStorage(zt),null==n)return E.cancelled;try{var e=JSON.parse(n),i=t.globalContext.googletag;i.pubads().getSlots().forEach(function(t){var n=e.targeting.slots[t.getSlotElementId()];null!=n&&Object.keys(n).forEach(function(e){t.setTargeting(e,n[e])})});var r=e.targeting,o=r.brandSafety,a=r.fr,u=r.custom;return null!=o&&Object.keys(o).forEach(function(t){i.pubads().setTargeting(t,o[t])}),null!=u&&Object.keys(u).forEach(function(t){var n=u[t];Array.isArray(n)?n.forEach(function(n){i.pubads().setTargeting(t,n)}):i.pubads().setTargeting(t,n)}),null!=a&&i.pubads().setTargeting("fr",a),E.completed}catch(t){throw new Error("Malformed targeting object at ".concat(zt))}},Jt="aps_targeting_illuma",Bt=new $({scope:"cxm",object:"illuma",action:"set",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,{status:Ht(n)}]})})}}),Ht=function(t){var n=t.readSessionStorage(Jt);if(t.deleteSessionStorage(Jt),null==n)return E.cancelled;var e=JSON.parse(n).results;if(null==e)throw new Error("Malformed targeting object at ".concat(Jt));var i=t.globalContext.googletag;return Object.keys(e).forEach(function(t){var n=e[t];i.pubads().setTargeting("".concat("illuma_").concat(t),JSON.stringify(n))}),E.completed},Gt=new $({scope:"cxm",object:"contextual",action:"set",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){switch(t.label){case 0:return[4,Promise.all([n.recordListener(Ut),n.recordListener(Ft),n.recordListener(Bt)])];case 1:return t.sent(),[2,{status:E.completed}]}})})}}),Wt=Q([Ut,Gt,Ft,Bt]),Kt={key:"customPlacement/hints",default:{}},$t={key:"customPlacement/bidResponses",default:{}},Qt=function(){function t(t,n,i){var r=this;this.CLICK_PREFIX_MACRO="%%CLICK_URL_PREFIX%%",this.PROGRAM_CUSTOM_PLACEMENTS="customPlacements",this.getPageStyles=function(t){return void 0===t&&(t=["p","h1","h2"]),t.map(r.getTagStyle).filter(function(t){return Object.keys(t).length>0}).reduce(function(t,n){return e(e({},t),n)},{})},this.getContainerStyles=function(t){try{if(!t)return{};var n=window.getComputedStyle(t),e="--aps-custom-container-",i=new Map;return i.set("".concat(e,"width"),n.width),i.set("".concat(e,"margin"),n.margin),i.set("".concat(e,"padding"),n.padding),Object.fromEntries(i.entries())}catch(t){return{}}},this.slotProps=t,this.rawResponse=n,this.At=i}return t.prototype.getTagStyle=function(t){var n=this.At.getElementsByTagName(t);if(n&&n[0]){var e=window.getComputedStyle(this.At.getElementsByTagName(t)[0]),i=new Map,r="--aps-custom-page-";return i.set("".concat(r).concat(t,"-color"),e.color),i.set("".concat(r).concat(t,"-fontFamily"),e.fontFamily),i.set("".concat(r).concat(t,"-fontSize"),e.fontSize),i.set("".concat(r).concat(t,"-fontWeight"),e.fontWeight),i.set("".concat(r).concat(t,"-lineHeight"),e.lineHeight),Object.fromEntries(i)}return{}},t.prototype.getDynamicFrameBodyHeight=function(t,n,i){var r;if(n){null==n||n.contentWindow;var o=(null==n?void 0:n.contentDocument)||(null===(r=null==n?void 0:n.contentWindow)||void 0===r?void 0:r.document),a=null==o?void 0:o.body.scrollHeight;n.style.height="".concat(a,"px");try{var u=e(e({},this.getPageStyles()),this.getContainerStyles(t));Object.keys(u).forEach(function(t){null==o||o.documentElement.style.setProperty(t,u[t])})}catch(t){}}},t.prototype.render=function(t){return this.Ct(t)},t.prototype.Ct=function(t){var n,e,i,r=this;if(!this.rawResponse||!this.slotProps)return!1;try{var o=this.rawResponse.size.split("x"),a=(null===(n=this.rawResponse.targeting)||void 0===n?void 0:n.amzniid)||this.rawResponse.amzniid,u=(null===(e=this.rawResponse.targeting)||void 0===e?void 0:e.amznadm)||this.rawResponse.amznadm;if(!a)return!1;var s=this.slotProps.kt;if(this.slotProps.location&&this.slotProps.id){var c=this.At.createElement("div");null===(i=this.At.getElementById(this.slotProps.id))||void 0===i||i.insertAdjacentElement(this.slotProps.location,c),s=c}if(!s)return!1;var d=this.At.createElement("iframe");return d.style.marginLeft="0",d.style.marginTop="0",d.style.height="".concat(o[1],"px"),d.style.width="100%",d.setAttribute("data-testid","amzn-asr-ad"),d.setAttribute("scrolling","no"),d.setAttribute("frameborder","0"),d.onload=function(){return r.getDynamicFrameBodyHeight(s,d,u?"amznadm":"admi")},d.srcdoc=u||"",t&&t.clickPrefix&&(d.srcdoc=d.srcdoc.replace(this.CLICK_PREFIX_MACRO,t.clickPrefix)),s.appendChild(d),this.updateSlotAttribute("status","rendered"),!0}catch(t){throw new Error("CustomPlacements: Error while rendering")}},t.prototype.updateSlotAttribute=function(t,n){var e;null===(e=this.slotProps.kt)||void 0===e||e.setAttribute("data-aps-custom-".concat(t),n)},t}(),Zt={key:"customPlacement/timings",default:[]},Yt=function(t,n,e,i){void 0===e&&(e=0),void 0===i&&(i=0);try{var r={effectiveType:null==n?void 0:n.effectiveType,rtt:null==n?void 0:n.rtt,downlink:null==n?void 0:n.downlink},o=function(t,n,e){try{var i=isNaN(n)||0===n?t.body.clientWidth:n,r=isNaN(e)||0===e?t.body.clientHeight:e;return"".concat(i,"x").concat(r)}catch(t){}return"x"}(t,e,i);return{connection:r,screen:o}}catch(t){return{}}},Xt=function(t,n,e){t.update(Zt,function(t){return t.push({time:performance.now(),key:"".concat(n,"/").concat(e)}),t})},tn="customPlacements",nn=new $({scope:"customPlacement",object:"hint",action:"process",validators:{},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r=t.account;return t.detail,t.customEvent,o(this,function(t){return n=function(t){var n;Xt(r,tn,"hint/process/".concat(t));var e=r.use(Kt),i=r.use($t);null!==(n=e[t].isRendered)&&void 0!==n&&n||(Object.values(i).forEach(function(n){var i;if(null===(i=n.isRendered)||void 0===i||!i){var o=r.globalContext.document.getElementById(t);if(null!=o){var a=new Qt({id:t,kt:o},n,r.globalContext.document);Xt(r,tn,"widget/render/".concat(t)),a.render(e[t].hintMetadata)&&(n.isRendered=!0,e[t].isRendered=!0)}}}),r.update(Kt,function(){return e}),r.update($t,function(){return i}))},e=r.use(Kt),Object.keys(e).filter(function(t){return e[t].default}).forEach(n),Object.keys(e).filter(function(t){return!e[t].default}).forEach(n),[2,{status:E.completed,analytics:{browserInfo:Yt(r.globalContext.document,null===(i=r.globalContext.navigator)||void 0===i?void 0:i.connection,r.globalContext.innerWidth,r.globalContext.innerHeight)}}]})})}}),en=new $({scope:"customPlacement",object:"hint",action:"define",validators:{},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a,u,s,c=t.account;t.detail;var d=t.customEvent;return o(this,function(t){if(void 0===(null===(u=d.detail)||void 0===u?void 0:u.id))throw new Error("Hint `id` must be defined");return n=d.detail,e=n.id,i=n.isDefault,r=n.hintMetadata,Xt(c,tn,"hint/define/".concat(e)),(a=c.use(Kt))[e]={default:"default"===i,isRendered:!1,hintMetadata:null!=r?r:{}},c.update(Kt,function(){return a}),c.recordListenerNonBlocking(nn),[2,{status:E.completed,analytics:{browserInfo:Yt(c.globalContext.document,null===(s=c.globalContext.navigator)||void 0===s?void 0:s.connection,c.globalContext.innerWidth,c.globalContext.innerHeight)}}]})})}}),rn={key:"customPlacement/placementResponseDispatched",default:!1},on={key:"customPlacement/placementResponse",default:void 0},an={key:"customPlacement/contextURL",default:void 0},un={key:"customPlacement/placementEndpoint",default:"https://c.aps.amazon-adsystem.com/e/placements"},sn={key:"ad/context",default:void 0},cn=new $({scope:"customPlacement",object:"placement",action:"fetch",validators:{},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.account;return t.detail,t.customEvent,o(this,function(t){switch(t.label){case 0:return Xt(i,tn,"placementFetch/start"),[4,ln(i)];case 1:return n=t.sent(),Xt(i,tn,"placementFetch/end"),[2,{status:E.completed,value:{placementResponse:n},analytics:{browserInfo:Yt(i.globalContext.document,null===(e=i.globalContext.navigator)||void 0===e?void 0:e.connection,i.globalContext.innerWidth,i.globalContext.innerHeight)}}]}})})}});function dn(t){var n=t.use(sn);return void 0!==n&&"user"in n?(n.user,i(n,["user"])):n}function ln(t){return r(this,void 0,void 0,function(){var n,e,i,r,a;return o(this,function(o){switch(o.label){case 0:return n={ortb2:dn(t)},e=t.use(an),i=t.use(un),r=function(t,n){try{var e=null!=n?n:function(t){var n,e;try{if(void 0!==(null===(n=t.globalContext.top)||void 0===n?void 0:n.location.href))return null===(e=t.globalContext.top)||void 0===e?void 0:e.location.href}catch(t){}try{if(t.globalContext.top!==t.globalContext.self)return t.globalContext.document.referrer}catch(t){}}(t);if(void 0!==e)return encodeURIComponent(e)}catch(t){}return""}(t,e),a=encodeURIComponent(JSON.stringify(n)),[4,fetch("".concat(i,"?account=").concat(t.id,"&u=").concat(r,"&sg=").concat(a))];case 1:return[4,o.sent().json()];case 2:return[2,o.sent()]}})})}var vn={key:"customPlacement/bidEndpoint",default:"c.aps.amazon-adsystem.com"},fn={key:"customPlacement/bidIsKey",default:"86355855cc6ed9e335d0382c8563aa10"},pn=new $({scope:"customPlacement",object:"bids",action:"fetch",validators:{},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a=t.account;return t.detail,t.customEvent,o(this,function(t){switch(t.label){case 0:return n=Yt(a.globalContext.document,null===(i=a.globalContext.navigator)||void 0===i?void 0:i.connection,a.globalContext.innerWidth,a.globalContext.innerHeight),void 0===(null===(r=a.globalContext.apstag)||void 0===r?void 0:r.clientFetchBids)?[2,{status:E.waiting,analytics:{browserInfo:n}}]:(Xt(a,tn,"fetchBids/start"),[4,hn(a)]);case 1:return e=t.sent(),Xt(a,tn,"fetchBids/end"),[2,{status:E.completed,value:{bidResponses:e},analytics:{browserInfo:n}}]}})})}});function hn(t){return r(this,void 0,void 0,function(){var n,e,i;return o(this,function(r){switch(r.label){case 0:return n={slots:[{slotID:"93b7dd52-a8ce-11ed-afa1-0242ac120002:1",sizes:[[999,999]]}],timeout:6e4,_endpointDomain:t.use(vn),params:{program:"apscustom",is:t.use(fn)}},e={pubID:t.id,isSelfServePub:36===t.id.length,deals:!0},i=t.use(an),[4,new Promise(function(r){var o;null===(o=t.globalContext.apstag)||void 0===o||o.clientFetchBids(n,function(t){r(t)},{initConfig:e,contextURL:i})})];case 1:return[2,r.sent()]}})})}var mn=new $({scope:"customPlacement",object:"service",action:"enable",validators:{},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e=t.account;return t.detail,t.customEvent,o(this,function(t){switch(t.label){case 0:return Xt(e,tn,"service/enable"),e.update(rn,function(){return!1}),[4,Promise.all([e.recordListener(cn).then(function(t){var n=t.placementResponse;wn(e,!0,n),e.update(on,function(){return n})}),e.recordListener(pn).then(function(t){t.bidResponses.forEach(function(t){var n,i,r=null!==(i=null===(n=t.targeting)||void 0===n?void 0:n.amzniid)&&void 0!==i?i:t.amzniid,o=!1;if(""!==r){var a=e.use($t);a[r]=t,e.update($t,function(){return a}),o=!0}wn(e,!1,{aps:[{active:o,dispatchEventOnValidBid:!0}]})})}).then(function(){e.recordListenerNonBlocking(nn)})])];case 1:return t.sent(),[2,{status:E.completed,analytics:{browserInfo:Yt(e.globalContext.document,null===(n=e.globalContext.navigator)||void 0===n?void 0:n.connection,e.globalContext.innerWidth,e.globalContext.innerHeight)}}]}})})}});function wn(t,n,e){var i;if(!t.use(rn)){var r=null===(i=null==e?void 0:e.aps)||void 0===i?void 0:i.find(function(t){return t.dispatchEventOnValidBid});n&&void 0!==r||(Xt(t,tn,"placementResponseEvent/dispatch"),t.record("customPlacement/placement/didRespond",e).catch(function(t){}),t.update(rn,function(){return!0}))}}var gn=new Map(s([],u(Q([en,pn,nn,mn,cn])),!1)),yn=function(t){function e(n){var e=t.call(this,n.message)||this;return e.message='Could not read vendor data because: "'.concat(n.message,'"'),e}return n(e,t),e}(Error),bn={key:"cxm/vendors",default:{}},_n={nonId:{noExtraDefaults:!0,source:"liveintent.com",atype:3},bidswitch:{source:"bidswitch.net",atype:3},openx:{source:"openx.net",atype:3},magnite:{source:"rubiconproject.com",atype:3},medianet:{source:"media.net",atype:3},pubmatic:{source:"pubmatic.com",atype:3},index:{source:"liveintent.indexexchange.com",atype:3},uid2:{source:"uidapi.com",atype:3},sovrn:{source:"liveintent.sovrn.com",atype:3},thetradedesk:{source:"adserver.org",atype:1},vidazoo:{source:"liveintent.vidazoo.com",atype:3},triplelift:{source:"liveintent.triplelift.com",atype:3},sharethrough:{source:"sharethrough.com",atype:3},sonobi:{source:"liveintent.sonobi.com",atype:3}};function xn(t){var n=[],e={user:{ext:{eids:n}}};return Object.entries(_n).forEach(function(e){var i=e[0],r=e[1];if(void 0!==t[i]){var o={source:r.source,uids:[{id:t[i],atype:r.atype}]};!0!==r.noExtraDefaults&&(o.uids[0].ext={provider:"liveintent.com"}),n.push(o)}}),e}var Sn="cxm/liveintent/set",En="cxm/arcspan/set",An="cxm/anomymised/set",Cn=new Map([["cxm/vendors/set",function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return o(this,function(t){switch(t.label){case 0:return[4,Promise.all([n.record(Sn),n.record(En),n.record(An)])];case 1:return t.sent(),[2,E.completed]}})})}],[Sn,function(t){return r(void 0,[t],void 0,function(t){var n,i=t.account;return t.customEvent,o(this,function(t){try{n=function(t){var n,e,i;try{i=t.readLocalStorage("__tamLIResolveResult")}catch(t){if(t instanceof Error)throw new yn(t)}if(null!=i&&(void 0===t.globalContext.liModuleEnabled&&(t.globalContext.liModuleEnabled=Math.random()<.95,null===(e=null===(n=t.globalContext)||void 0===n?void 0:n.googletag)||void 0===e||e.cmd.push(function(){t.globalContext.googletag.pubads().setTargeting("li-module-enabled",t.globalContext.liModuleEnabled?["on"]:["off"])})),t.globalContext.liModuleEnabled)){var r=void 0;try{r=xn(JSON.parse(i))}catch(t){r=xn(JSON.parse(decodeURIComponent(i)))}if(void 0!==r)return{data:{default:r}}}}(i)}catch(t){if(t instanceof yn)return[2,{status:E.cancelled,analytics:{statusReason:t.message}}];throw t}return void 0===n?[2,E.cancelled]:(i.update(bn,function(t){var i;return e(e({},t),((i={}).liveintent=n,i))}),[2,E.completed])})})}],[En,function(t){return r(void 0,[t],void 0,function(t){var n,i=t.account;return o(this,function(t){return n=function(t){var n=t.globalContext.arcobj1,e=t.globalContext.arcobj2,i=[],r=[],o=[];if(void 0!==n){if(void 0!==n.page_iab_codes.text&&(i=i.concat(n.page_iab_codes.text)),void 0!==n.page_iab_codes.images&&(i=i.concat(n.page_iab_codes.images)),void 0!==n.page_keywords){var a="string"==typeof n.page_keywords?n.page_keywords.split(","):n.page_keywords;o=o.concat(a),void 0!==(null==e?void 0:e.compcohorts)&&(o=o.concat(e.compcohorts))}void 0!==n.page_iab_newcodes.text&&(r=s([],u(new Set(s(s([],u(r),!1),u(n.page_iab_newcodes.text),!1))),!1)),void 0!==n.page_iab_newcodes.images&&(r=s([],u(new Set(s(s([],u(r),!1),u(n.page_iab_newcodes.images),!1))),!1));var c={name:"arcspan",segment:[],ext:{segtax:6}};r.forEach(function(t){c.segment=c.segment.concat({id:t})});var d={data:[]};return d.data=d.data.concat(c),{data:{default:{site:{name:"arcspan",cat:i,sectioncat:i,pagecat:i,keywords:o.toString(),content:d,domain:new URL(t.globalContext.location.href).hostname,page:t.globalContext.location.href,ref:t.globalContext.document.referrer}}}}}}(i),void 0===n?[2,E.cancelled]:(i.update(bn,function(t){return e(e({},t),{arcspan:n})}),[2,E.completed])})})}],[An,function(t){return r(void 0,[t],void 0,function(t){var n,i=t.account;return t.customEvent,o(this,function(t){try{n=function(t){var n;try{n=t.readLocalStorage("cohort_ids")}catch(t){if(t instanceof Error)throw new yn(t)}if("string"==typeof n){for(var e=JSON.parse(n),i="",r=0;r1500)throw new Error("Id length of ".concat(100*Math.ceil(e.length/100)," (normalized) exceeds ").concat(1500," character limit"));return null!=e?((n={})[Ln]=decodeURIComponent(e),n):null},zn="audigent",Fn=new $({scope:"idVendors",object:"audigent",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(Vn,n)]})})}}),Vn=function(t){var n,e,i=null!==(e=t.readLocalStorage("hadronId"))&&void 0!==e?e:t.readLocalStorage("auHadronId");return null!=i?((n={})[zn]=i,n):null},Jn=["cto_bidid"],Bn=new $({scope:"idVendors",object:"criteo",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(new On("criteo").using(Dn).fromLocalStorageKeys(Jn).forAccount(n).getRunner(),n)]})})}}),Hn="id5id",Gn=new $({scope:"idVendors",object:"id5",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(Wn,n)]})})}}),Wn=function(t){var n,e=t.readLocalStorage(Hn);return null!=e?((n={}).id5=JSON.parse(decodeURIComponent(e)).universal_uid,n):null},Kn={key:"idVendors/enabled",default:JSON.stringify([])},$n=["__uid2_advertising_token"],Qn=function(t){var n,e;return null!==(e=null===(n=null==t?void 0:t.latestToken)||void 0===n?void 0:n.advertising_token)&&void 0!==e?e:null},Zn=new $({scope:"idVendors",object:"uid",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(new On("uid").using(Mn(Qn)).fromLocalStorageKeys($n).forAccount(n).getRunner(),n)]})})}}),Yn="pair",Xn=["pairId"],te=["_lr_pairId"],ne=function(t){var n,e,i;return(null===(n=null==t?void 0:t.envelope)||void 0===n?void 0:n.pop)&&null!==(i=null===(e=null==t?void 0:t.envelope)||void 0===e?void 0:e.pop())&&void 0!==i?i:null},ee=new $({scope:"idVendors",object:"pair",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(function(t){var n;return null!==(n=new On(Yn).using(Pn).fromCookieOrLocalStorageKeys(Xn).forAccount(t).getRunner()())&&void 0!==n?n:new On(Yn).using(function(t){return function(n){return"string"==typeof n?Mn(t)(atob(decodeURIComponent(n))):null}}(ne)).fromCookieOrLocalStorageKeys(te).forAccount(t).getRunner()()},n)]})})}}),ie="yahoo",re="connectId",oe=new $({scope:"idVendors",object:"yahoo",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(ae,n)]})})}}),ae=function(t){var n,e=t.readLocalStorage(re);return null!=e&&(e=JSON.parse(e)[re]),null!=e?((n={})[ie]=e,n):null},ue="lotame",se=new $({scope:"idVendors",object:"lotame",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(ce,n)]})})}}),ce=function(t){var n,e=t.readLocalStorage("panoramaId");return null!=e?((n={})[ue]=e,n):null},de="publink",le=["_publink_srv","_publink","pbjs_publink"],ve=new $({scope:"idVendors",object:"publink",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n=t.account;return t.customEvent,o(this,function(t){return[2,In(fe,n)]})})}}),fe=function(t){var n,e,i;try{for(var r=a(le),o=r.next();!o.done;o=r.next()){var u=o.value,s=t.readCookieStorage(u);if(null!=s){var c=void 0;try{c=JSON.parse(s).publink}catch(t){c=s}if(null!=c)return(i={})[de]=c,i}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}return null},pe="liveRamp",he="_lr_env",me="idl_env",we="apstagLiveRampTimestamp";!function(t){t[t.oldTimestamp=0]="oldTimestamp",t[t.newTimestamp=1]="newTimestamp",t[t.noTimestamp=2]="noTimestamp"}(Tn||(Tn={}));var ge,ye=new $({scope:"idVendors",object:"liveramp",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a=t.account;return t.customEvent,o(this,function(t){return n=_e(be(a),a),e=function(){var t;return null!=n?((t={})[pe]=n.id,t):null},i=function(){var t;return null!=n?((t={})[pe]=n.newGen,t):null},[2,(r=In(e,a)).status===E.completed?jn(i,a):r]})})}}),be=function(t){var n=t.readLocalStorage(he);if(null!=n)return n;var e=t.readCookieStorage(he);if(null!=e)return e;var i=t.readLocalStorage(me);if(null!=i)return i;var r=t.readCookieStorage(me);return null!=r?r:null},_e=function(t,n){if(null!=t&&""!==t)try{var e=JSON.parse(atob(decodeURIComponent(t))),i={id:e.envelope,newGen:Tn.noTimestamp};if(null!=e.timestamp){var r=n.readLocalStorage(we);null==r||r1}(n))?[2,E.completed]:function(t){var n=t.read(Y,{persist:!0});return void 0!==n&&new Date>=new Date(Number(n))}(n)?(function(t){t.delete(Y,{persist:!0}),function(t){var n;null===(n=t.globalContext.apstagDEBUG)||void 0===n||delete n.url}(t)}(n),[2,E.completed]):(function(t){t.record(Je).catch(function(t){}),t.record(Ge).catch(function(t){})}(n),[2,E.waiting])})})}],["debug/listeners/show",function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.systemAccount;return o(this,function(t){return n=i.store.get(d),e=s([],u(n.entries()),!1),console.groupCollapsed("⌂ Listeners"),console.table(e),console.groupEnd(),[2,E.completed]})})}]]),$e=[Ve],Qe=new Map(s(s([],u(Ke),!1),u(Q($e)),!1));!function(t){t[t.unspecifiedUnknown=0]="unspecifiedUnknown",t[t.lowEntropy=1]="lowEntropy",t[t.highEntropy=2]="highEntropy"}(ge||(ge={}));var Ze=["brands","mobile","platform"],Ye=["architecture","bitness","fullVersionList","model","platformVersion"],Xe=new $({scope:"deviceSignal",object:"sua",action:"set",validators:{context:{context:q,"context.apstag":q,"context.navigator":q,"context.navigator.userAgentData":q,"context.navigator.userAgentData.getHighEntropyValues":H,"context.navigator.userAgentData.architecture":B(L),"context.navigator.userAgentData.bitness":B(L),"context.navigator.userAgentData.mobile":B(U),"context.navigator.userAgentData.model":B(L),"context.navigator.userAgentData.platform":B(L),"context.navigator.userAgentData.platformVersion":B(L),"context.navigator.userAgentData.fullVersionList":B(F),"context.navigator.userAgentData.fullVersionList[]":q,"context.navigator.userAgentData.fullVersionList[].brand":L,"context.navigator.userAgentData.fullVersionList[].version":L,"context.navigator.userAgentData.brands":B(F),"context.navigator.userAgentData.brands[]":q,"context.navigator.userAgentData.brands[].brand":L,"context.navigator.userAgentData.brands[].version":L}},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a,u,s=t.account;return o(this,function(t){switch(t.label){case 0:return void 0===(null===(r=s.globalContext.apstag)||void 0===r?void 0:r.isGDPRRegion)?[2,{status:E.waiting}]:(n="deviceSignal/sua",e=null===(a=s.globalContext.navigator)||void 0===a?void 0:a.userAgentData,"string"==typeof(i=s.read(n,{persist:!0,throwOnDisallowed:!1}))?s.write(n,i):e instanceof Object&&function(t,n,e){t.write(n,JSON.stringify(ni(e)))}(s,n,e),!1!==(null===(u=s.globalContext.apstag)||void 0===u?void 0:u.isGDPRRegion)?[2,{status:E.completed}]:"function"!=typeof(null==e?void 0:e.getHighEntropyValues)?[3,2]:[4,ti(s,n,e)]);case 1:t.sent(),t.label=2;case 2:return[2,{status:E.completed}]}})})}});function ti(t,n,e){return r(this,void 0,void 0,function(){var i;return o(this,function(r){switch(r.label){case 0:return[4,e.getHighEntropyValues(s(s([],u(Ze),!1),u(Ye),!1))];case 1:return i=r.sent(),t.write(n,JSON.stringify(ni(i)),{persist:!0,throwOnDisallowed:!1}),[2,E.completed]}})})}function ni(t){var n,e,i,r={};return r.architecture=t.architecture,r.bitness=t.bitness,r.mobile=t.mobile?1:0,r.model=t.model,r.source=(i=t,Ye.some(function(t){return i[t]})?ge.highEntropy:Ze.some(function(t){return i[t]})?ge.lowEntropy:ge.unspecifiedUnknown),"string"==typeof t.platform&&(r.platform={brand:t.platform,version:null===(n=t.platformVersion)||void 0===n?void 0:n.split(".")}),Array.isArray(t.fullVersionList)?e=t.fullVersionList:Array.isArray(t.brands)&&(e=t.brands),e instanceof Array&&(r.browsers=e.map(function(t){var n;return{brand:t.brand,version:null===(n=t.version)||void 0===n?void 0:n.split(".")}})),r}var ei,ii=Q([Xe]),ri={key:"deviceSignal/cookieDeprecationLabel",default:void 0},oi=new $({scope:"deviceSignal",object:"cookieDeprecationLabel",action:"set",handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.account;return t.customEvent,o(this,function(t){switch(t.label){case 0:return void 0===(null==(n=i.globalContext.navigator.cookieDeprecationLabel)?void 0:n.getValue)||"function"!=typeof n.getValue?[2,{status:E.cancelled}]:[4,i.executeFuncWithConsent(n,n.getValue)];case 1:return void 0===(e=t.sent())||""===e?[2,{status:E.cancelled}]:(i.update(ri,function(){return e}),[2,{status:E.completed,analytics:{gcdl:e}}])}})})}}),ai=Q([oi]),ui={key:"_monitoring/statusesByEventIdentifier",default:new Map},si=function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a,u=t.account,s=t.customEvent;return o(this,function(t){if(void 0===(n=null===(a=s.detail)||void 0===a?void 0:a.eventIdentifier))throw new Error("Missing eventIdentifier parameter");return e=u.use(ui),i="".concat(s.type,":").concat(n),void 0!==(r=e.get(i))?[2,r]:[2,E.waiting]})})},ci=function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a,u,s=t.account,c=t.customEvent;return o(this,function(t){if(void 0===(n=null===(r=c.detail)||void 0===r?void 0:r.eventIdentifier))throw new Error("Missing eventIdentifier parameter");if(void 0===(e=null===(a=c.detail)||void 0===a?void 0:a.statusUpdate))throw new Error("Missing statusUpdate parameter");if(!(e in E))throw new Error("Invalid statusUpdate parameter. Expected one of ".concat(Object.values(E).join(", ")));if(void 0===(i=null===(u=c.detail)||void 0===u?void 0:u.pairedEvents)||i.length<1||i.some(function(t){return"string"!=typeof t}))throw new Error("Parameter pairedEvents must be a non-empty array of string");return i.forEach(function(t){var i="".concat(t,":").concat(n);s.update(ui,function(t){return t.set(i,e)})}),[2,E.completed]})})},di=new Map([["_monitor/testing/only",si],["_update/testing/only",ci],["_legacy/bidRequest/monitor",si],["_legacy/bidRequest/didComplete",ci]]),li=new $({scope:"prebid",object:"analyticsEvent",action:"track",handler:function(t){return r(void 0,[t],void 0,function(t){var n,i,r,a,u,s,c,d=t.account,l=t.customEvent;return o(this,function(t){switch(t.label){case 0:return void 0===(null===(r=l.detail)||void 0===r?void 0:r.eventType)||void 0===(null===(a=l.detail)||void 0===a?void 0:a.eventArgs)||void 0===(null===(c=null===(s=null===(u=l.detail)||void 0===u?void 0:u.config)||void 0===s?void 0:s.options)||void 0===c?void 0:c.accountID)?[2,{status:E.cancelled}]:(n={eventType:l.detail.eventType,metadata:l.detail.metadata,config:l.detail.config},[4,d.globalContext.fetch("".concat("https://prod.us-east-1.cxm-bcn.publisher-services.amazon.dev/v1/events/prebid"),vi(l.detail))]);case 1:return(i=t.sent()).ok?[2,{status:E.completed,analytics:n}]:[2,{status:E.cancelled,analytics:e(e({},n),{message:"Request failed: ".concat(i.status)})}]}})})}}),vi=function(t){var n={accountId:t.config.options.accountID,events:[{eventArgs:t.eventArgs,eventType:t.eventType}]};return{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}},fi={key:"prebid/config",default:void 0};!function(t){t.NotStarted="NOT STARTED",t.Loading="LOADING",t.Complete="COMPLETE"}(ei||(ei={}));var pi,hi,mi={key:"prebid/configRequestState",default:ei.NotStarted},wi=new $({scope:"prebid",object:"config",action:"fetch",handler:function(t){return r(void 0,[t],void 0,function(t){var n,i,r,a,u,s,c,d,l,v=t.account,f=t.customEvent;return o(this,function(t){switch(t.label){case 0:if((n=v.use(mi))===ei.Loading)return[2,{status:E.waiting}];if(i={metadata:null===(l=null==f?void 0:f.detail)||void 0===l?void 0:l.metadata},n===ei.Complete&&void 0!==(r=v.use(fi)))return[2,{status:E.completed,value:JSON.parse(r),analytics:i}];t.label=1;case 1:return t.trys.push([1,4,,5]),v.update(mi,function(){return ei.Loading}),a="".concat("https://c.amazon-adsystem.com/cdn/prod/config","?src=").concat(v.id),[4,v.globalContext.fetch(a)];case 2:return u=t.sent(),v.update(mi,function(){return ei.Complete}),u.ok?[4,u.json()]:[2,{status:E.cancelled,analytics:e(e({},i),{message:"Config request failed"})}];case 3:return s=t.sent(),c=gi(v,s),v.update(fi,function(){return JSON.stringify(c)},{persist:!0}),[2,{status:E.completed,value:c,analytics:i}];case 4:return d=t.sent(),[2,{status:E.cancelled,analytics:e(e({},i),{message:d.message})}];case 5:return[2]}})})}}),gi=function(t,n){var e,i,r,o;return{analyticsConfig:{options:{accountID:t.id,sampling:null===(e=n.pbjs)||void 0===e?void 0:e.sampleRate},includeEvents:null===(i=n.pbjs)||void 0===i?void 0:i.allowedEvents},idConfig:{params:{accountID:t.id,enabled:null===(r=n.pbjs)||void 0===r?void 0:r.enabled,treatments:null===(o=n.pbjs)||void 0===o?void 0:o.treatments}}}},yi={key:"prebid/eidsConfig",default:"{}"};!function(t){t.APSSignalIQ="_apsIdTreatment",t.Audigent="hadronId",t.ID5="id5id",t.Liveramp="idl_env",t.Lotame="lotamePanoramaId",t.Pubcommon="pubcid",t.Publink="publinkId",t.ThirtyThree="33acrossId",t.Yahoo="connectId"}(hi||(hi={}));var bi=new Map([[zn,hi.Audigent],["id5",hi.ID5],[pe,hi.Liveramp],[ue,hi.Lotame],[xe,hi.Pubcommon],[de,hi.Publink],[Ln,hi.ThirtyThree],[ie,hi.Yahoo]]),_i=((pi={})[hi.Audigent]={source:"audigent.com",atype:1},pi[hi.ID5]={source:"id5-sync.com",atype:1},pi[hi.Liveramp]={source:"liveramp.com",atype:3},pi[hi.Lotame]={source:"crwdcntrl.net",atype:1},pi[hi.Pubcommon]={source:"pubcid.org",atype:1},pi[hi.Publink]={source:"epsilon.com",atype:3},pi[hi.ThirtyThree]={source:"33across.com",atype:1},pi[hi.Yahoo]={source:"yahoo.com",atype:3},pi),xi=new $({scope:"prebid",object:"eidsConfig",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n,i,r,a,u=t.account,s=t.customEvent;return o(this,function(t){return void 0===(null===(i=u.globalContext.apstag)||void 0===i?void 0:i._atsaaiod)?[2,{status:E.waiting}]:(u.update(yi,function(){return JSON.stringify(e({},_i))},{persist:!0}),n={metadata:null===(r=null==s?void 0:s.detail)||void 0===r?void 0:r.metadata,config:null===(a=null==s?void 0:s.detail)||void 0===a?void 0:a.config},[2,{status:E.completed,analytics:n}])})})}}),Si=new Set(s(["CONTROL_HOLD_OUT","CLEAN"],u(bi.keys()),!1));var Ei,Ai={key:"prebid/ids",default:void 0},Ci=new $({scope:"prebid",object:"ids",action:"get",handler:function(t){return r(void 0,[t],void 0,function(t){var n,i,r,s,c,d,l,v,f=t.account,p=t.customEvent;return o(this,function(t){switch(t.label){case 0:return void 0===(null===(c=f.globalContext.apstag)||void 0===c?void 0:c._atsaaiod)?[2,{status:E.waiting}]:(f.recordListenerNonBlocking(Te),void 0!==(n=f.use(kn))&&(i=Object.fromEntries(Object.entries(n).map(function(t){var n=u(t,2),e=n[0],i=n[1];return[bi.get(e),i]}))),[4,f.recordListener(wi,{metadata:null===(d=null==p?void 0:p.detail)||void 0===d?void 0:d.metadata})]);case 1:return r=t.sent(),s={metadata:null===(l=null==p?void 0:p.detail)||void 0===l?void 0:l.metadata},null!==(v=r.idConfig.params.enabled)&&void 0!==v&&v?(null!=r.idConfig.params.treatments&&(i=function(t,n){if(!function(t){var n=t.reduce(function(t,n){return t+n.percent},0),e=100===n,i=t.reduce(function(t,n){var e=n.treatment;return t&&Si.has(e)},!0);return e&&i}(n))return t;var i=function(t){var n,e,i=100*Math.random(),r=0;try{for(var o=a(t),u=o.next();!u.done;u=o.next()){var s=u.value;if(i<=(r+=s.percent))return s.treatment}}catch(t){n={error:t}}finally{try{u&&!u.done&&(e=o.return)&&e.call(o)}finally{if(n)throw n.error}}throw new Error("Invalid treatment percentages")}(n);return function(t,n){var i,r=((i={})[hi.APSSignalIQ]=n,i),o=bi.get(n);switch(n){case"CONTROL_HOLD_OUT":return e(e({},t),r);case"CLEAN":return r;default:return void 0!==o&&void 0!==(null==t?void 0:t[o])&&(r[o]=t[o]),r}}(t,i)}(i,r.idConfig.params.treatments)),f.update(Ai,function(){return i}),[2,{status:E.completed,value:i,analytics:s}]):[2,{status:E.cancelled,analytics:s}]}})})}}),ki=Q([li,wi,xi,Ci]),Ri=function(t){return t===Ei.noConsent?"AMZN-NoCookieConsent":"AMZN-Token"};!function(t){t[t.noConsent=0]="noConsent",t[t.token=1]="token"}(Ei||(Ei={}));var Ii,ji,Oi=function(t){t.setCookieStorage(Ri(Ei.token),"",0),t.setCookieStorage(Ri(Ei.noConsent),"",0)},Di=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a=t.setToken;return Oi(n),"boolean"!=typeof a&&(a=!0),Pi({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}).then(function(t){var e=t.AIPToken,i=t.cookieExpiry;return Mi({AIPToken:e,cookieExpiry:i,account:n,setToken:a})})},Pi=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString;return fetch("https://tk.amazon-adsystem.com/envelope",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ni({account:n,hashedRecords:e,ttl:i,isGDPRRegion:r,tcString:o}))}).then(function(t){if(!t.ok)throw new Error("Token http status error: ".concat(t.status));return t.json()})},Mi=function(t){var n=t.AIPToken,e=t.cookieExpiry,i=t.account,r=t.setToken;if("string"!=typeof n||"number"!=typeof e)throw new Error("Invalid AIPES response");if(""===n)throw i.setCookieStorage(Ri(Ei.noConsent),"1",e),new Error("Empty token");(r||"boolean"!=typeof r)&&i.setCookieStorage(Ri(Ei.token),n,e)},Ni=function(t){var n=t.account,e=t.hashedRecords,i=t.ttl,r=t.isGDPRRegion,o=t.tcString,a={publisherId:n.id,hashedRecords:e};return void 0!==i&&(a.ttl=i),r?(a.gdpr=1,o&&(a.gdprConsent=o)):a.gdpr=0,a},Ti=new $({scope:"ad",object:"record",action:"delete",handler:function(t){return r(void 0,[t],void 0,function(t){var n,e=t.account;return o(this,function(t){if(!(null===(n=e.globalContext.apstag)||void 0===n?void 0:n._atsaaiod))return[2,{status:E.waiting}];if(!e.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return Oi(e),[2,{status:E.completed}]})})}}),Li={detail:q,"detail.setCookie":B(U),"detail.config":q,"detail.config.optOut":B(U),"detail.config.ttl":B(T),"detail.config.gdpr":B(q),"detail.config.gdpr.cmpTimeout":B(T),"detail.config.gdpr.enabled":B(W),"detail.config.gdpr.consent":B(L),"detail.config.gdpr.cmpGlobal":B(L),"detail.config.gdpr.cmpGlobalv2":B(L),"detail.config.hashedRecords":F,"detail.config.hashedRecords[]":q,"detail.config.hashedRecords[].type":L,"detail.config.hashedRecords[].record":L,"detail.config.hashedRecords[].encrypted":B(T),"detail.config.hashedRecords[].toJSON":G,"detail.config.hashedRecords[].$$typeof":G,"detail.config.hashedRecords[].constructor":G,"detail.config.hashedRecords[].tagName":G,"detail.config.hashedRecords[].@@__IMMUTABLE_ITERABLE__@@":G,"detail.config.hashedRecords[].@@__IMMUTABLE_RECORD__@@":G},Ui=new $({scope:"ad",object:"record",action:"renew",validators:{detail:Li,context:{context:q}},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r,a=t.account,u=t.detail;return o(this,function(t){switch(t.label){case 0:if(!(null===(i=a.globalContext.apstag)||void 0===i?void 0:i._atsaaiod))return[2,{status:E.waiting}];if(void 0===(null==u?void 0:u.config))throw new Error("Missing tokenConfig object");if(!a.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return(null!==(r=a.readCookieStorage(Ri(Ei.token)))&&void 0!==r?r:"").length>0?[2,{status:E.cancelled}]:(n=a.globalContext.apstag.isGDPRRegion,e=a.use(It),[4,(o={account:a,hashedRecords:u.config.hashedRecords,ttl:u.config.ttl,isGDPRRegion:n,tcString:null==e?void 0:e.tcString},Di(o))]);case 1:return t.sent(),[2,{status:E.completed}]}var o})})}});!function(t){t.email="email"}(Ii||(Ii={})),function(t){t.Display="display",t.Video="video",t.MultiFormat="multi-format"}(ji||(ji={}));var qi,zi=/^[0-9a-fA-F]{64}$/,Fi=function(t){return zi.test(t||"")},Vi=function(t){return t.then(function(t){return Array.from(new Uint8Array(t)).map(function(t){return t.toString(16).padStart(2,"0")}).join("")}).then(function(t){return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"!==t?t:""})},Ji=function(t,n){return"string"==typeof t&&(n===Ii.email?/\S+@\S+\.\S+/.test(t)||Fi(t):t.trim().length>0)},Bi=function(t,n,e){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Ji(n.value,e)?Vi(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.value||""))):Promise.resolve(""):Ji(n.innerText,e)?Vi(t.globalContext.crypto.subtle.digest("SHA-256",(new t.globalContext.TextEncoder).encode(n.innerText||""))):Promise.resolve("")};!function(t){t.LOCAL_STORAGE="LOCAL",t.CSS_SELECTOR="CSS",t.URL="URL"}(qi||(qi={}));var Hi=function(t,n,e){var i,r;void 0===n&&(n={}),function(t){var n,e=((n={})[qi.LOCAL_STORAGE]=5,n[qi.URL]=4,n[qi.CSS_SELECTOR]=3,n),i={};t.forEach(function(t){i[t.method]=(i[t.method]||0)+1,t.priority=i[t.method]}),t.sort(function(t,n){return t.method===n.method?(t.priority||0)>(n.priority||0)?1:-1:e[t.method]>e[n.method]?-1:1})}(n.methods||[]);var o,u=[],s=function(n){var i=n.method,r=n.target,a=n.type,s="";switch(i){case qi.LOCAL_STORAGE:s=function(t,n,e){var i=t.readLocalStorage(n);return i&&Ji(i,e)?i:""}(t,r,a);break;case qi.URL:u.push(function(t,n,e){e=null!=e?e:t.globalContext.location.href,n=n.replace(/[[\]]/g,"\\$&");var i=new RegExp("[?&#]"+n+"(=([^&#?]*)|&|#|$)").exec(e);return Array.isArray(i)&&"string"==typeof i[2]&&0!==decodeURIComponent(i[2].replace(/\+/g," ")).trim().length&&Fi(decodeURIComponent(i[2].replace(/\+/g," ")))?Promise.resolve(decodeURIComponent(i[2].replace(/\+/g," "))):new Promise(function(t){return t("")})}(t,r).then(function(t){return{type:a,value:t}}));break;case qi.CSS_SELECTOR:o=n}if(s.length>0)return e({value:s,type:a}),{value:void 0}};try{for(var c=a(n.methods||[]),d=c.next();!d.done;d=c.next()){var l=s(d.value);if("object"==typeof l)return l.value}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}var v=function(){if(o&&(!0===o.isGlobalSubmit||"string"==typeof o.eventTarget&&"string"==typeof o.event)){var n=o.eventTarget,i=o.target,r=o.type,u=o.isGlobalSubmit,s=u?"submit":o.event;if("string"==typeof s&&0!==s.length){var c=function(o){return function(t){var n,e=t.account,i=t.e,r=t.eventTarget,o=t.event,u=t.isGlobalSubmit,s=t.target,c=t.type,d=t.onDone,l=t.listener;u||"window"===r||i.target&&"function"==typeof i.target.matches&&"string"==typeof r&&i.target.matches(r)?(u&&i instanceof Event&&i.target&&(n=i.target.querySelectorAll('input[type="email"]')),function(t,n,e,i){var r,o,u=i||t.globalContext.document.querySelectorAll(n);if(0===u.length)return new Promise(function(t){return t("")});if(1===u.length)return Bi(t,u[0],e);var s=[];try{for(var c=a(u),d=c.next();!d.done;d=c.next()){var l=d.value;s.push(Bi(t,l,e))}}catch(t){r={error:t}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}return Promise.all(s).then(function(t){var n,e,i=null;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(""!==u){if(null!==i&&("string"!=typeof i||i!==u))return"";i=u}}}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}return null!=i?i:""})}(e,s,c,n).then(function(t){"function"==typeof l&&e.globalContext.removeEventListener(o,l),d(!(t.length<1)&&{value:t,type:c})})):d(!1)}({account:t,e:o,event:s,eventTarget:n,isGlobalSubmit:u,target:i,type:r,onDone:e,listener:c})};t.globalContext.addEventListener(s,c)}else e(!1)}else e(!1)};if(0!==u.length)return Promise.all(u).then(function(t){var n,i;try{for(var r=a(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(u.value.length>0)return void e(u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}v()});v()},Gi={called:!1};function Wi(t,n){return new Promise(function(e,i){if(Gi.called&&!n.overrideLimit)throw new Error("rr should only be called once per page load");Gi.called=!0;var r=0,o=function(){var a=function(){var r,o,a=t.use(It);return(!(null===(r=t.globalContext.apstag)||void 0===r?void 0:r.isGDPRRegion)||void 0!==a)&&(void 0===a||t.isAllowedToAccessInfoOnDevice()?(null===(o=Hi(t,n,function(n){if(!1===n)return e("no retrieval");Di({account:t,hashedRecords:[{type:n.type,record:n.value}],source:"rr",tcString:null==a?void 0:a.tcString}).then(function(){e("token generated")}).catch(i)}))||void 0===o||o.catch(i),!0):"canceled")}(),u=r>6400;if(a||u)return"canceled"===a&&i(new Error("tcf timeout")),void(u&&i(new Error("interval over")));setTimeout(o,r),r=0===r?200:2*r};o()})}var Ki=new $({scope:"ad",object:"record",action:"rr",validators:{detail:{detail:q,"detail.config":q,"detail.config.$$typeof":G,"detail.config.tagName":G,"detail.config.@@__IMMUTABLE_ITERABLE__@@":G,"detail.config.@@__IMMUTABLE_RECORD__@@":G,"detail.config.accountID":B(L),"detail.config.overrideLimit":B(U),"detail.config.methods":F,"detail.config.methods[].tagName":G,"detail.config.methods[]":J(q),"detail.config.methods[].$$typeof":G,"detail.config.methods[].@@__IMMUTABLE_ITERABLE__@@":G,"detail.config.methods[].@@__IMMUTABLE_RECORD__@@":G,"detail.config.methods[].type":V(Object.values(Ii)),"detail.config.methods[].method":V(Object.values(qi)),"detail.config.methods[].target":B(L),"detail.config.methods[].event":B(L),"detail.config.methods[].eventTarget":B(L),"detail.config.methods[].isGlobalSubmit":B(U),"detail.config.methods[].priority":B(T)},context:{context:q,"context.Promise":H,"context.crypto":q,"context.crypto.subtle":H}},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.account,r=t.detail;return o(this,function(t){switch(t.label){case 0:if(!(null===(e=i.globalContext.apstag)||void 0===e?void 0:e._atsaaiod))return[2,{status:E.waiting}];if(!i.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return[4,Wi(i,r.config)];case 1:return n=t.sent(),[2,{status:E.completed,analytics:{rr:n}}]}})})}}),$i=new $({scope:"ad",object:"record",action:"update",validators:{detail:Li,context:{context:q}},handler:function(t){return r(void 0,[t],void 0,function(t){var n,e,i,r=t.account,a=t.detail;return o(this,function(t){switch(t.label){case 0:if(!(null===(i=r.globalContext.apstag)||void 0===i?void 0:i._atsaaiod))return[2,{status:E.waiting}];if(!r.isAllowedToAccessInfoOnDevice())throw new Error("Not allowed to access storage on device");return n=r.globalContext.apstag.isGDPRRegion,e=r.use(It),a.config.optOut?(Oi(r),[3,3]):[3,1];case 1:return[4,Di({account:r,hashedRecords:a.config.hashedRecords,ttl:a.config.ttl,isGDPRRegion:n,tcString:null==e?void 0:e.tcString,setToken:null==a?void 0:a.setCookie})];case 2:t.sent(),t.label=3;case 3:return[2,{status:E.completed}]}})})}}),Qi=Q([Ti,Ui,Ki,$i]),Zi=new Map([["ad/ASRSlot/render",function(t){return r(void 0,[t],void 0,function(t){var n,e,i=t.account,r=t.customEvent;return o(this,function(t){if(void 0===(null===(n=r.detail)||void 0===n?void 0:n.id)||void 0===(null===(e=r.detail)||void 0===e?void 0:e.targeting))throw new Error("Missing event detail");return function(t,n,e,i){var r,o,a,u=e.globalContext.document.createElement("iframe"),s=null===(r=n.get("amznsz"))||void 0===r?void 0:r.split("x"),c=n.get("amzniid"),d=t;if(!(void 0===c||void 0===d||void 0===s||s.length<2)){u.style.marginLeft="0",u.style.marginTop="0",u.style.height="".concat(s[1],"px"),u.style.width="100%",u.setAttribute("scrolling","no"),u.setAttribute("frameborder","0");var l=e.globalContext.document.createElement("div"),v=null!==(o=null==i?void 0:i.location)&&void 0!==o?o:"afterend",f=e.globalContext.document.getElementById(d);if(null!=f){f.insertAdjacentElement(v,l),l.appendChild(u);var p=null===(a=null==u?void 0:u.contentWindow)||void 0===a?void 0:a.document;void 0!==p&&(p.open(),p.write('